package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordHaircutMapper;
import com.letian.record.domain.RecordHaircut;
import com.letian.record.service.IRecordHaircutService;

/**
 * 记录发型Service业务层处理
 * 
 * @author bmz
 * @date 2023-05-15
 */
@Service
public class RecordHaircutServiceImpl implements IRecordHaircutService 
{
    @Autowired
    private RecordHaircutMapper recordHaircutMapper;

    /**
     * 查询记录发型
     * 
     * @param haircutId 记录发型主键
     * @return 记录发型
     */
    @Override
    public RecordHaircut selectRecordHaircutByHaircutId(Long haircutId)
    {
        return recordHaircutMapper.selectRecordHaircutByHaircutId(haircutId);
    }

    /**
     * 查询记录发型列表
     * 
     * @param recordHaircut 记录发型
     * @return 记录发型
     */
    @Override
    public List<RecordHaircut> selectRecordHaircutList(RecordHaircut recordHaircut)
    {
        return recordHaircutMapper.selectRecordHaircutList(recordHaircut);
    }

    /**
     * 新增记录发型
     * 
     * @param recordHaircut 记录发型
     * @return 结果
     */
    @Override
    public int insertRecordHaircut(RecordHaircut recordHaircut)
    {
        recordHaircut.setCreateTime(DateUtils.getNowDate());
        return recordHaircutMapper.insertRecordHaircut(recordHaircut);
    }

    /**
     * 修改记录发型
     * 
     * @param recordHaircut 记录发型
     * @return 结果
     */
    @Override
    public int updateRecordHaircut(RecordHaircut recordHaircut)
    {
        recordHaircut.setUpdateTime(DateUtils.getNowDate());
        return recordHaircutMapper.updateRecordHaircut(recordHaircut);
    }

    /**
     * 批量删除记录发型
     * 
     * @param haircutIds 需要删除的记录发型主键
     * @return 结果
     */
    @Override
    public int deleteRecordHaircutByHaircutIds(Long[] haircutIds)
    {
        return recordHaircutMapper.deleteRecordHaircutByHaircutIds(haircutIds);
    }

    /**
     * 删除记录发型信息
     * 
     * @param haircutId 记录发型主键
     * @return 结果
     */
    @Override
    public int deleteRecordHaircutByHaircutId(Long haircutId)
    {
        return recordHaircutMapper.deleteRecordHaircutByHaircutId(haircutId);
    }
}
